import request from "../../http";
const couponApi = {
  async getCouponData(params) {
    return request({
      url: "v1/api/coupon",
      method: "get",
      data: params
    });
  },
  async queryCouponData(query) {
    return request({
      url: "v1/api/coupon",
      method: "get",
      params: query
    });
  },
  async getCouponDetail(couponId) {
    return request({
      url: `v1/api/coupon/${couponId}`,
      method: "get"
    });
  },
  async getCouponIdDetail(query) {
    return request({
      url: "/api/coupon/select/detail",
      method: "get",
      params: query
    });
  },
  async postCouponData(params) {
    return request({
      url: "v1/api/coupon",
      method: "post",
      data: params
    });
  },
  async editCouponData(params) {
    return request({
      url: `v1/api/coupon/${params.id}`,
      method: "put",
      data: params
    });
  },
  // 店铺选择
  async getShop() {
    return request({
      url: "/api/supplier/coupon/select",
      method: "get"
    });
  },
  // 批量导入指定用户
  async batchUsers(params) {
    return request({
      url: "/api/coupon/import/batch",
      method: "post",
      data: params
    });
  },
  // 下载指定用户模块
  async downloadTemplate() {
    return request({
      url: "/api/coupon/downloadTemplate",
      method: "get",
      responseType: "blob"
    });
  }
};
export default couponApi;
